package cn.gson.springboot.model.pojos;

import javax.persistence.*;
import java.sql.Date;
import java.sql.Time;
import java.util.Objects;

@Entity
@Table(name = "complain_", schema = "crm")
public class Complain {
    private int complainId;
    private String complainTheme;
    private String complainDescribe;
    private Integer complainType;
    private Integer complainUrgentLevel;
    private Integer complainHandleResult;
    private String complainReturnVisit;
    private String complainFeedback;
    private Integer complainCostTime;
    private Date complainDate;
    private Time complainTime;
    private String complainRemarks;
    private String complainContactName;
    private Customer customerByCustomerId;
    private Employee employeeByEmpId;

    @Id
    @Column(name = "complain_id", nullable = false)
    public int getComplainId() {
        return complainId;
    }

    public void setComplainId(int complainId) {
        this.complainId = complainId;
    }



    @Basic
    @Column(name = "complain_theme", nullable = true, length = 255)
    public String getComplainTheme() {
        return complainTheme;
    }

    public void setComplainTheme(String complainTheme) {
        this.complainTheme = complainTheme;
    }

    @Basic
    @Column(name = "complain_describe", nullable = true, length = 255)
    public String getComplainDescribe() {
        return complainDescribe;
    }

    public void setComplainDescribe(String complainDescribe) {
        this.complainDescribe = complainDescribe;
    }

    @Basic
    @Column(name = "complain_type", nullable = true)
    public Integer getComplainType() {
        return complainType;
    }

    public void setComplainType(Integer complainType) {
        this.complainType = complainType;
    }

    @Basic
    @Column(name = "complain_urgent_level", nullable = true)
    public Integer getComplainUrgentLevel() {
        return complainUrgentLevel;
    }

    public void setComplainUrgentLevel(Integer complainUrgentLevel) {
        this.complainUrgentLevel = complainUrgentLevel;
    }

    @Basic
    @Column(name = "complain_handle_result", nullable = true)
    public Integer getComplainHandleResult() {
        return complainHandleResult;
    }

    public void setComplainHandleResult(Integer complainHandleResult) {
        this.complainHandleResult = complainHandleResult;
    }

    @Basic
    @Column(name = "complain_return_visit", nullable = true, length = 255)
    public String getComplainReturnVisit() {
        return complainReturnVisit;
    }

    public void setComplainReturnVisit(String complainReturnVisit) {
        this.complainReturnVisit = complainReturnVisit;
    }

    @Basic
    @Column(name = "complain_feedback", nullable = true, length = 255)
    public String getComplainFeedback() {
        return complainFeedback;
    }

    public void setComplainFeedback(String complainFeedback) {
        this.complainFeedback = complainFeedback;
    }

    @Basic
    @Column(name = "complain_cost_time", nullable = true)
    public Integer getComplainCostTime() {
        return complainCostTime;
    }

    public void setComplainCostTime(Integer complainCostTime) {
        this.complainCostTime = complainCostTime;
    }

    @Basic
    @Column(name = "complain_date", nullable = true)
    public Date getComplainDate() {
        return complainDate;
    }

    public void setComplainDate(Date complainDate) {
        this.complainDate = complainDate;
    }

    @Basic
    @Column(name = "complain_time", nullable = true)
    public Time getComplainTime() {
        return complainTime;
    }

    public void setComplainTime(Time complainTime) {
        this.complainTime = complainTime;
    }

    @Basic
    @Column(name = "complain_remarks", nullable = true, length = 255)
    public String getComplainRemarks() {
        return complainRemarks;
    }

    public void setComplainRemarks(String complainRemarks) {
        this.complainRemarks = complainRemarks;
    }

    @Basic
    @Column(name = "complain_contact_name", nullable = true, length = 255)
    public String getComplainContactName() {
        return complainContactName;
    }

    public void setComplainContactName(String complainContactName) {
        this.complainContactName = complainContactName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Complain complain = (Complain) o;
        return complainId == complain.complainId &&
                Objects.equals(complainTheme, complain.complainTheme) &&
                Objects.equals(complainDescribe, complain.complainDescribe) &&
                Objects.equals(complainType, complain.complainType) &&
                Objects.equals(complainUrgentLevel, complain.complainUrgentLevel) &&
                Objects.equals(complainHandleResult, complain.complainHandleResult) &&
                Objects.equals(complainReturnVisit, complain.complainReturnVisit) &&
                Objects.equals(complainFeedback, complain.complainFeedback) &&
                Objects.equals(complainCostTime, complain.complainCostTime) &&
                Objects.equals(complainDate, complain.complainDate) &&
                Objects.equals(complainTime, complain.complainTime) &&
                Objects.equals(complainRemarks, complain.complainRemarks) &&
                Objects.equals(complainContactName, complain.complainContactName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(complainId, complainTheme, complainDescribe, complainType, complainUrgentLevel, complainHandleResult, complainReturnVisit, complainFeedback, complainCostTime, complainDate, complainTime, complainRemarks, complainContactName);
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }

    @ManyToOne
    @JoinColumn(name = "emp_id", referencedColumnName = "emp_id")
    public Employee getEmployeeByEmpId() {
        return employeeByEmpId;
    }

    public void setEmployeeByEmpId(Employee employeeByEmpId) {
        this.employeeByEmpId = employeeByEmpId;
    }
}
